package com.wiscamp.ninechapters.panels.infrastructure.converters;


import com.wiscamp.ninechapters.panels.domain.entities.Dictionary;
import com.wiscamp.ninechapters.panels.infrastructure.po.DictionaryPO;
import com.wiscamp.ninechapters.panels.infrastructure.views.DictionaryView;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface DictionaryConverter {
    DictionaryConverter Instance = Mappers.getMapper(DictionaryConverter.class);

    Dictionary toDictionary(DictionaryPO po);

    Dictionary toDictionaryByView(DictionaryView view);

    DictionaryPO toDictionaryPO(Dictionary entity);

    DictionaryPO toDictionaryPO(Dictionary entity, @MappingTarget DictionaryPO po);

}
